package com.finley.flowabledemo.design.responsibility.process;


/**
 * @description:
 * @author: xianfei.chao
 * @date 2025/6/1 11:02
 * @version: 1.0
 */
public class TestMain {

    public static void main(String[] args) {
        // 1、单目模组老化
        // 2、PCBA测试
        // 3、双目模组装配
        // 4、整机组装一
        // 5、整机组装二
        // 6、绑定老化车
        // 7、整机老化
        DanMuProcess danMuProcess = new DanMuProcess("单目老化");
        PCBAProcess pcbaProcess = new PCBAProcess("PCBA测试");
        ShuangMuProcess shuangMuProcess = new ShuangMuProcess("双目模组装配");
        Test1Process test1Process = new Test1Process("整机组装一");
        Test2Process test2Process = new Test2Process("整机测试二");
        LaoHuaProcess laoHuaProcess = new LaoHuaProcess("绑定老化车");
        danMuProcess.setNextHandler(pcbaProcess);
        pcbaProcess.setNextHandler(shuangMuProcess);
        shuangMuProcess.setNextHandler(test1Process);
        test1Process.setNextHandler(test2Process);
        test2Process.setNextHandler(laoHuaProcess);
        laoHuaProcess.setNextHandler(null);

        Process process = new Process();
        process.setType("LaoHua");

        System.out.println(danMuProcess.process(process));
        /**
         * 1、根据工单号和sn查询过站履历表的最新一条数据
         * 2、如果不存在,则从第一站开始过站
         * 3、如果存在,则从最新一条数据的下一站开始过站
         * 4、直到责任链中所有的工序都过站完成,则返回成功
         * 5、如果到责任链中没有工序处理,则返回失败
         */
    }
}
